<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //三种声明函数方式
        //命名函数     
        fn();
        function fn() {
            console.log('ok');
        }
        // fn();

        //匿名函数
        var fn1 = function () {
            console.log('hello');
        }
        fn1();

        //new Function(参数1，参数2，...，函数体)
        // var fn2 = new Function("console.log('hi')");
        var fn2 = new Function('x', 'y', 'z', "console.log(x+y+z)");
        fn2(1, 2, 3);
        console.dir(fn2);
        //instanceof运算符 判断前边的对象是不是后边的类的实例
        console.log(fn2 instanceof Object);
    </script>
</body>

</html>